class tuoZhuai{
			constructor(){
				this.oDiv = document.querySelector('div');
				this.down()
			}
			down(){
					var _this=this;
				this.oDiv.onmousedown = function(ev){
					var ev = ev||event;
					_this.disX = ev.clientX - _this.oDiv.offsetLeft;
					_this.disY = ev.clientY - _this.oDiv.offsetTop;
					document.onmousemove = function(ev){
						 _this.x = ev.clientX - _this.disX;
						 _this.y = ev.clientY - _this.disY;
						 _this.oDiv.style.left = _this.x +'px';
						 _this.oDiv.style.top = _this.y +'px';
					} 
					document.onmouseup = function(){
						document.onmousedown = null;
						document.onmousemove = null;
					}
					return false;	
				}
			}
		}
			window.onload = function(){
				new tuoZhuai();
			}